<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddExtractCashTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('extract_cash', function (Blueprint $table) {
            $table->increments('id')->comment('唯一ID');
            $table->integer('user_id')->comment('用户ID');
            $table->double('cash_money',10,2)->comment('提取金额');
            $table->integer('extract_state')->default(1)->comment('状态');
            $table->string('wechat_account')->nullable()->commnet('微信账号');
            $table->string('alipay_account')->nullable()->commnet('支付宝账号');
            $table->foreign('user_id')->references('id')->on('home_users');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('extract_cash');
    }
}
